Skip to content

Conversation

@rsmithlal
Copy link
Member

@rsmithlal rsmithlal commented Mar 7, 2025

This pull request introduces a comprehensive set of features for link checking and reporting within the BetterTogether metrics system. It adds new models, background jobs, controllers, and mailers to support automated link validation, reporting, and visualization. The changes are grouped into three main themes: link checking jobs, reporting and controller logic, and metrics visualization.

Link Checking Infrastructure:

  • Added background jobs for checking external and internal links (ExternalLinkCheckerJob, InternalLinkCheckerJob), including queueing logic for distributing link checks across hosts and time windows to avoid overload (RichTextLinkCheckerQueueJob and its subclasses). [1] [2] [3] [4] [5]
  • Introduced the BetterTogether::Content::Link model to persist discovered links and their metadata, and a namespace helper for links-related tables. [1] [2]

Reporting and Controller Logic:

  • Implemented LinkCheckerReportsController to support creating, listing, and downloading link checker reports, including Turbo Stream support for dynamic updates.
  • Added a scheduler job for generating and emailing link checker reports (LinkCheckerReportSchedulerJob) and a mailer for delivering these reports. [1] [2]
  • Added an event reminder scan job to periodically enqueue reminders for upcoming events.

Metrics Visualization and Testing:

  • Enhanced metrics reporting by aggregating link data for charts (links by host, invalid links by host, failures over time) and exposed these in the metrics reports controller.
  • Updated the metrics charts controller and JavaScript to render new charts for link-related metrics. [1] [2] [3]
  • Added the webmock gem for stubbing external HTTP requests in specs, improving test reliability.

Helps to identify broken links and generate reports on the internal and external links in platform rich texts.
- Implement RichTextLinkIdentifier service to extract and persist links from ActionText::RichText records.
- Create ExternalLinkCheckerJob and InternalLinkCheckerJob for checking link validity.
- Update Rake tasks for identifying and checking links.
- Add specs for the new jobs and the RichTextLinkIdentifier service.
- Include WebMock for stubbing HTTP requests in tests.
- Add diagrams and documentation for the link checking process.
- Introduce WebMock gem for stubbing external HTTP requests in specs.
@rsmithlal rsmithlal merged commit f7ab3c5 into main Sep 3, 2025
12 checks passed
@rsmithlal rsmithlal deleted the feature/metrics/rich-text-links branch September 3, 2025 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants